package com.googlecode.flair.icons
{
	import com.googlecode.flair.icons.tango.*;
	
	import mx.modules.Module;

	

	public class TangoIconsGalery extends Module implements IIconGalery
	{
		
		private var galery16x16 : Array = 
						[new TangoActions16x16(), new TangoApps16x16(), new TangoMimetypes16x16(), new TangoCategories16x16()
						, 
						new TangoDevices16x16(), new TangoEmblems16x16(), new TangoEmotes16x16(), 
						new TangoPlaces16x16(), new TangoStatus16x16
						];

		private var galery22x22 : Array = 
						[new TangoActions22x22(), new TangoApps22x22(), new TangoMimetypes22x22()
						, new TangoCategories22x22(), 
						new TangoDevices22x22(), new TangoEmblems22x22(), new TangoEmotes22x22(), 
						new TangoPlaces22x22(), new TangoStatus22x22()
						];
		
		private var galery32x32 : Array = 
						[new TangoActions32x32(), new TangoApps32x32(), new TangoMimetypes32x32()
						, new TangoCategories32x32(), 
						new TangoDevices32x32(), new TangoEmblems32x32(), new TangoEmotes32x32(), 
						new TangoPlaces32x32(), new TangoStatus32x32()
						];
		
		private var _sizes : Array = ["16x16", "22x22", "32x32"];
		
		private var _categories : Array = ["Actions", "Apps", "Mime Types", 
			"Categories", "Devices", "Emblems", 
			"Emoticons", "Places", "Status"];
		
		private var galeries : Array = [galery16x16, galery22x22, galery32x32];
		
		public function get sizes():Array
		{
			return _sizes;
		}
		
		public function get categories():Array
		{
			return _categories;
		}
		
		public function getIcons(category:String, size:String) : Array
		{
			var sizeIndex : int = _sizes.indexOf(size);
			if (sizeIndex > -1 && sizeIndex < galeries.length) {
				var theGalery : Array = galeries[sizeIndex];
				var categIndex : int = _categories.indexOf(category);
				if (categIndex > -1 && categIndex < theGalery.length) {
					var iconGalery : Object = theGalery[categIndex];
					return iconGalery["icons"] as Array;
				}
			}
			return [];
		}
		
	}
}